package com.sxran.im.handler;

import com.sxran.im.info.ImGroup;
import com.sxran.im.info.ImUser;
import com.sxran.im.service.UserService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;

@Service
public class WebrtcAnswerCmdHandler extends AbstractCmdHandler<ImUser>{

    private Logger logger = LoggerFactory.getLogger(WebrtcAnswerCmdHandler.class);

    @Resource
    private UserService userService;
    @Override
    public Object doBeanService(ImUser bean) {
        String userId = bean.getUserId();
        // 用户基本信息
        ImUser imUser = userService.selectByUserId(userId);  // imUserMapper.selectById(userId);
        // 朋友
        List<ImGroup> friends = new ArrayList<>();
        imUser.setFriends(friends);

        return imUser;
    }
}
